package com.erp.sell.domain;

import com.erp.common.annotation.Excel;
import com.erp.common.annotation.Excels;
import com.erp.sell.handler.ProductListHandler;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * --- 不丢始终 ---
 *
 * @author lzx
 * @date 2025/9/3
 * @desc
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class ErpSalesOrderVO extends ErpSalesOrder{
    /** 销售订单商品列表 */
    @Excel(name = "商品信息", width = 50, handler = ProductListHandler.class)
    private List<ErpSalProductsVO> erpSalProductsVOList;
    
    /** 客户信息 */
    @Excels({
        @Excel(name = "客户名称", targetAttr = "custName", width = 20),
        @Excel(name = "客户联系方式", targetAttr = "contact", width = 25),
        @Excel(name = "客户地址", targetAttr = "addr", width = 30),
        @Excel(name = "客户类型", targetAttr = "custType", width = 15)
    })
    private ErpCustomer erpCustomer;

    // @Override
    // public String toString() {
    //     return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
    //             // ErpSalesOrder
    //             .append("orderId", getOrderId())
    //             .append("userId", getUserId())
    //             .append("totalAmt", getTotalAmt())
    //             .append("orderTime", getOrderTime())
    //             .append("status", getStatus())
    //             // ErpProductsPrices
    //             .append("erpProductsPricesList",getErpSalProductsVOList())
    //             // ErpCustomer
    //             .append("custId", erpCustomer.getCustId())
    //             .append("custName", erpCustomer.getCustName())
    //             .append("custType", erpCustomer.getCustType())
    //             .append("phone", erpCustomer.getPhone())
    //             .append("contact", erpCustomer.getContact())
    //             .append("addr", erpCustomer.getAddr())
    //             .append("mainCat", erpCustomer.getMainCat())
    //             .toString();
    // }

}
